imports('../../../style/index');

var layer = require('layer');
var router = require('{com}/router');
var placeholder = require('placeholder');
var register = require('../register/register');
var loginjs = require('../login/login');
var index = require('../login/index');
var footer = require('{list}/script/views/footer');
var template = require('template');

return {
    path:'/login/',
    wrapper:'#login',
    events:{
        'click .j-login':'login',
        'click .j-register':'register'
    },
    onInit:function(){
        
    },
    onAfter:function(){
        index();
        if($('#login .l-footer').length <= 0){
            $('#login').append(template.render(footer, {}));
        }
    },
    login:function(){
        loginjs();
    },
    register:function(){
        router.location('/register/')
    }
}